﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="../themes/default/easyui.css" rel="stylesheet" />
    <link href="../themes/icon.css" rel="stylesheet" />
    <link href="Css/Site.css" rel="stylesheet" />
    <script src="../script/jquery.min.js"></script>
    <script src="../script/jquery.easyui.min.js"></script>
	<meta charset="utf-8" />
</head>
<body>
    <table id="dg">
        <div id="tb">
            <div>
                <a href="javascript:void(0)" class="easyui-linkbutton Insert" data-options="iconCls:'icon-add'">新增</a>

                <a href="javascript:void(0)" class="easyui-linkbutton Update" data-options="iconCls:'icon-edit'">修改</a>

                <a href="javascript:void(0)" class="easyui-linkbutton Delete" data-options="iconCls:'icon-remove'">删除</a>

                <a href="javascript:void(0)" class="easyui-linkbutton Assign" data-options="iconCls:'icon-ok'">分配管理员</a>
            </div>
            <div>
                店铺名称：<input id="txtshopName" type="text" />
                联系人：<input id="txtprop" type="text" />
                店铺地址：<input id="txtshopid" type="text" />
                <a href="otherpage.php" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>

            </div>
        </div>
        <div id="dlg" class="easyui-dialog" data-options="iconCls:'icon-save',closed:true">
            <iframe id="frm1" width="99%" height="99%" frameborder="0"></iframe>
        </div>
    </table>
    <script type="text/javascript">
        $(function () {
            $('#dg').datagrid({
                url: '/jquery-easyui-1.4.3/demo/datagrid/datagrid_data1.json',
                method: "get",
                columns: [[
                    { field: 'productid', title: '店铺编号', width: 100, align: 'right' },
                    { field: 'productname', title: '店铺名称', width: 100 },
                    { field: 'name', title: '店铺类型', width: 100 },
                    { field: 'name', title: '联系人', width: 100 },
                    { field: 'name', title: '联系电话', width: 100 },
                    { field: 'name', title: '地址', width: 100 },
                ]]
            });
            //添加用户
            $('.Insert').click(function () {

                $('#dlg').dialog({ width: 400, height: 400 })
                .dialog("setTitle", "添加用户")
                .dialog("open");
                $("#frm1").attr("src", "04_shopAdd.html");

            })
            //修改用户
            $('.Update').click(function () {
                var row = $("#dg").datagrid("getSelected");
                if (row != null) {
                    $("#dlg").dialog({ width: 400, height: 400 })
                .dialog("setTitle", "修改用户信息")
                .dialog("open");
                    $("#frm1").attr("src", "05_shopUpdate.html");
                }
                else {
                    $.messager.alert('提示', '请选择要编辑的行!', "warning");
                }
            })

            //删除用户
            $('.Delete').click(function () {
                var row = $("#dg").datagrid("getSelected");
                if (row != null) {
                    $("#dlg").dialog({ width: 400, height: 400 })
                .dialog("setTitle", "删除用户信息")
                    //.dialog("open");
                    //    $("#frm1").attr("src", "03_shopUpdate.html");
                    $.messager.alert('确认', '确认要删除记录么?', "warning")
                    //alert('确认删除');
                }
                else {
                    $.messager.alert('确认', '请选择要删除记录!', "warning")
                }
            })
            //分配管理员
            $('.Assign').click(function () {

                $('#dlg').dialog({ width: 400, height: 400 })
                .dialog("setTitle", "分配管理员")
                .dialog("open");
                $("#frm1").attr("src", "07_Username.html");

            })


        })
    </script>

</body>
</html>
